package com.xjrsoft.module.customerTwo.barin.t_intelligent_manufacturing_solutions.service.impl;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.xjrsoft.module.customerTwo.barin.t_intelligent_manufacturing_solutions.entity.TIntelligentManufacturingSolutions;
import com.xjrsoft.module.customerTwo.barin.t_intelligent_manufacturing_solutions.dto.TIntelligentManufacturingSolutionsListDto;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.xjrsoft.common.page.ConventPage;
import com.xjrsoft.common.page.PageOutput;
import java.util.List;
import com.xjrsoft.module.customerTwo.barin.t_intelligent_manufacturing_solutions.mapper.TIntelligentManufacturingSolutionsMapper;
import com.xjrsoft.module.customerTwo.barin.t_intelligent_manufacturing_solutions.service.ITIntelligentManufacturingSolutionsService;
import com.xjrsoft.core.mp.base.BaseService;
import com.xjrsoft.core.tool.utils.Func;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;

/**
 *  服务实现类
 *
 * @author dongxinhang
 * @since 2024-11-18
 */
@Service
@AllArgsConstructor
public class TIntelligentManufacturingSolutionsServiceImpl extends BaseService<TIntelligentManufacturingSolutionsMapper, TIntelligentManufacturingSolutions> implements ITIntelligentManufacturingSolutionsService {


	@Override
	public IPage<TIntelligentManufacturingSolutions> getPageList(TIntelligentManufacturingSolutionsListDto pageListDto) {
		Wrapper<TIntelligentManufacturingSolutions> wrapper = Wrappers.<TIntelligentManufacturingSolutions>query().lambda();
		return this.page(ConventPage.getPage(pageListDto), wrapper);
	}

	@Override
	public boolean addTIntelligentManufacturingSolutions(TIntelligentManufacturingSolutions tIntelligentManufacturingSolutions) {
		boolean isSuccess = this.save(tIntelligentManufacturingSolutions);
		return isSuccess;
	}

	@Override
	public boolean updateTIntelligentManufacturingSolutions(String id, TIntelligentManufacturingSolutions tIntelligentManufacturingSolutions) {
		tIntelligentManufacturingSolutions.setFid(id);
		return this.updateById(tIntelligentManufacturingSolutions);
	}

	public boolean delete(String ids) {
		List<String> idList = Func.toStrList(ids);
		if (this.removeByIds(idList)) {
			return true;
		}
		return false;
	}

}